package com.student.model;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * EmploymentSituation entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Employment_Situation", schema = "dbo", catalog = "StudentManager")
public class EmploymentSituation implements java.io.Serializable {

	// Fields

	private Long employmentSituation;
	private GraduateInfo graduateInfo;
	private OccupationType occupationType;
	private GraduateWorkUnit graduateWorkUnit;
	private Double employmentWage;
	private String employmentPosition;
	private Timestamp employmentDate;
	private Set<GraduateInfo> graduateInfos = new HashSet<GraduateInfo>(0);

	// Constructors

	/** default constructor */
	public EmploymentSituation() {
	}

	/** minimal constructor */
	public EmploymentSituation(Long employmentSituation, Double employmentWage,
			String employmentPosition) {
		this.employmentSituation = employmentSituation;
		this.employmentWage = employmentWage;
		this.employmentPosition = employmentPosition;
	}

	/** full constructor */
	public EmploymentSituation(Long employmentSituation,
			GraduateInfo graduateInfo, OccupationType occupationType,
			GraduateWorkUnit graduateWorkUnit, Double employmentWage,
			String employmentPosition, Timestamp employmentDate,
			Set<GraduateInfo> graduateInfos) {
		this.employmentSituation = employmentSituation;
		this.graduateInfo = graduateInfo;
		this.occupationType = occupationType;
		this.graduateWorkUnit = graduateWorkUnit;
		this.employmentWage = employmentWage;
		this.employmentPosition = employmentPosition;
		this.employmentDate = employmentDate;
		this.graduateInfos = graduateInfos;
	}

	// Property accessors
	@Id
	@Column(name = "Employment_Situation", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getEmploymentSituation() {
		return this.employmentSituation;
	}

	public void setEmploymentSituation(Long employmentSituation) {
		this.employmentSituation = employmentSituation;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Graduate_id")
	public GraduateInfo getGraduateInfo() {
		return this.graduateInfo;
	}

	public void setGraduateInfo(GraduateInfo graduateInfo) {
		this.graduateInfo = graduateInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Occupation_Type_id")
	public OccupationType getOccupationType() {
		return this.occupationType;
	}

	public void setOccupationType(OccupationType occupationType) {
		this.occupationType = occupationType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Work_Unit_id")
	public GraduateWorkUnit getGraduateWorkUnit() {
		return this.graduateWorkUnit;
	}

	public void setGraduateWorkUnit(GraduateWorkUnit graduateWorkUnit) {
		this.graduateWorkUnit = graduateWorkUnit;
	}

	@Column(name = "Employment_Wage", nullable = false, scale = 4)
	public Double getEmploymentWage() {
		return this.employmentWage;
	}

	public void setEmploymentWage(Double employmentWage) {
		this.employmentWage = employmentWage;
	}

	@Column(name = "Employment_Position", nullable = false, length = 50)
	public String getEmploymentPosition() {
		return this.employmentPosition;
	}

	public void setEmploymentPosition(String employmentPosition) {
		this.employmentPosition = employmentPosition;
	}

	@Column(name = "Employment_Date", length = 23)
	public Timestamp getEmploymentDate() {
		return this.employmentDate;
	}

	public void setEmploymentDate(Timestamp employmentDate) {
		this.employmentDate = employmentDate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "employmentSituation")
	public Set<GraduateInfo> getGraduateInfos() {
		return this.graduateInfos;
	}

	public void setGraduateInfos(Set<GraduateInfo> graduateInfos) {
		this.graduateInfos = graduateInfos;
	}

}